<template>
    <view class="page-box">
        <header class="header"></header>
        <view class="section">
            <view class="relationship-chain">
                <view class="title">关系链</view>
                <view class="list row  verCenter">
                    <view class="box column rowCenter verCenter">
                        <image :src="channelUserInfo.relation.wx_photo" mode="aspectFill"></image>
                        <text class="tt">{{channelUserInfo.relation.name}}</text>
                        <text class="arrow"></text>
                    </view>
                    <view class="box column rowCenter verCenter">
                        <image :src="channelUserInfo.relation.children.wx_photo" mode="aspectFill"></image>
                        <text class="tt">{{channelUserInfo.relation.children.name}}</text>
                    </view>
                </view>
            </view>
            <view class="base-info">
                <view class="title">基本信息</view>
                <view class="input-wrap">
                    <text class="label">真实姓名：</text>
                    <text class="tt">{{channelUserInfo.baseInfo.name}}</text>
                </view>
                <view class="input-wrap">
                    <text class="label">加入时间：</text>
                    <text class="tt">{{channelUserInfo.baseInfo.create_time}}</text>
                </view>
                <view class="input-wrap">
                    <text class="label">手机号码：</text>
                    <text class="tt">{{channelUserInfo.baseInfo.tel}}</text>
                </view>
                <view class="input-wrap">
                    <text class="label">会员开通：</text>
                    <text class="tt">{{channelUserInfo.baseInfo.create_time}}</text>
                </view>
                <view class="input-wrap" style="margin-bottom: 0;">
                    <text class="label">会员到期：</text>
                    <text class="tt">{{channelUserInfo.baseInfo.expire_time}}</text>
                </view>
                <view class="info-list row avarage verCenter">
                    <view class="box column rowCenter verCenter">
                        <text class="t1">预审件数</text>
                        <text class="t2">{{channelUserInfo.orderCount.pre_order_count}}</text>
                    </view>
                    <view class="box column rowCenter verCenter">
                        <text class="t1">进件件数</text>
                        <text class="t2">{{channelUserInfo.orderCount.order_count}}</text>
                    </view>
                    <view class="box column rowCenter verCenter">
                        <text class="t1">放款件数</text>
                        <text class="t2">{{channelUserInfo.orderCount.lending_order_count}}</text>
                    </view>
                </view>
                <view class="info row rowCenter verCenter">
                    <text class="t1">放款金额：</text>
                    <text class="t2">{{channelUserInfo.orderCount.lending_order_amount}}</text>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
    import { API } from '@/util/api.js';
    export default {
        data() {
            return {
                channelUserInfo: {},
                channel_user_id: ''
            };
        },
        onLoad(options) {
            this.channel_user_id = options.channel_user_id;
        },
        onShow() {
            this.getData();
        },
        methods: {
            getData() {
                this.request(API.channelUserInfo, 'GET', { channel_user_id: this.channel_user_id }, true).then(res => {
                    if (res.code === 0) {
                        this.channelUserInfo = res.data;
                    } else {
                        uni.showToast({
                            title: res.msg,
                            icon: 'none'
                        });
                    }
                });
            }
        }
    };
</script>

<style scoped lang="scss">
    @import '@/assets/css/order/teamDetail.scss';
</style>